﻿using System;
using System.Collections.Generic;
using System.Configuration.Internal;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LogToFile
{
    public class PLCLog:LogBase
    {
        private static object obj;

        public static bool IsLogAll;

        static PLCLog()
        {
            obj = new object();
            IsLogAll = false;
            try
            {
                string text = "1";
                if (!string.IsNullOrEmpty(text) && text == "1")
                {
                    IsLogAll = true;
                }
            }
            catch (Exception)
            {
            }
        }

        public static void Debug(object message)
        {
            lock (obj)
            {
                LogBase.plcLog.Debug(message);
            }
        }

        public static void DebugFormatted(string format, params object[] args)
        {
            lock (obj)
            {
                LogBase.plcLog.DebugFormat(format, args);
            }
        }

        public static void Error(object message)
        {
            lock (obj)
            {
                LogBase.plcLog.Error(message);
            }
        }

        public static void Error(object message, Exception exception)
        {
            lock (obj)
            {
                LogBase.plcLog.Error(message, exception);
            }
        }

        public static void ErrorFormatted(string format, params object[] args)
        {
            lock (obj)
            {
                LogBase.plcLog.ErrorFormat(format, args);
            }
        }

        public static void Fatal(object message)
        {
            lock (obj)
            {
                LogBase.plcLog.Fatal(message);
            }
        }

        public static void Fatal(object message, Exception exception)
        {
            lock (obj)
            {
                LogBase.plcLog.Fatal(message, exception);
            }
        }

        public static void FatalFormatted(string format, params object[] args)
        {
            lock (obj)
            {
                LogBase.plcLog.FatalFormat(format, args);
            }
        }

        public static void Info(object message)
        {
            lock (obj)
            {
                LogBase.plcLog.Info(message);
            }
        }

        public static void InfoFormatted(string format, params object[] args)
        {
            lock (obj)
            {
                LogBase.plcLog.InfoFormat(format, args);
            }
        }

        public static void Warn(object message)
        {
            lock (obj)
            {
                LogBase.plcLog.Warn(message);
            }
        }

        public static void Warn(object message, Exception exception)
        {
            lock (obj)
            {
                LogBase.plcLog.Warn(message, exception);
            }
        }

        public static void WarnFormatted(string format, params object[] args)
        {
            lock (obj)
            {
                LogBase.plcLog.WarnFormat(format, args);
            }
        }
    }
}
